/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.fiap.backbean;
import br.com.fiap.beans.Aluno;
import java.util.ArrayList;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

@ManagedBean(name="listaAluno")
@SessionScoped
/**
 *
 * @author rm62971
 */
public class ListaAluno {

    private ArrayList<Aluno> aluno;
    private Aluno a = new Aluno();

    public ArrayList<Aluno> getAluno(){
        return aluno;
    }

    public Aluno getA() {
        return a;
    }

    public void setA(Aluno a) {
        this.a = a;
    }

    public ListaAluno(){
        aluno = new ArrayList<Aluno>();
        Aluno a1 = new Aluno();
        a1.setNome("Megan");
        a1.setSobrenome("Fox");
        a1.setNota(10.00);
        aluno.add(a1);
    }

    public Double AumentaNota(Aluno a){
        a.setNota(a.getNota() + 1);
        return null;
    }

    public String adicionar(){
        aluno.add(a);
        a = new Aluno();
        return null;
    }
}
